<template>
  <div class="alert-card" :style="{ background: color }">
    <div class="card-title">{{ title }}</div>
    <div class="card-count">{{ count }}</div>
    <div class="card-diff">较昨日 {{ diff }}</div>
  </div>
</template>
<script setup>
defineProps({
  title: String,
  count: [String, Number],
  diff: String,
  color: String
})
</script>
<style scoped>
.alert-card {
  flex: 1 1 200px;
  border-radius: 10px;
  padding: 16px 20px;
  min-width: 160px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: 0 2px 8px #f0f1f2;
  transition: all 0.3s ease;
}

.card-title { 
  font-size: 15px; 
  font-weight: 500; 
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.card-count { 
  font-size: 26px; 
  font-weight: bold; 
  margin-bottom: 4px;
}

.card-diff { 
  font-size: 13px; 
  color: rgba(0, 0, 0, 0.65); 
}

@media (max-width: 1400px) {
  .alert-card {
    min-width: 140px;
    padding: 14px 16px;
  }
  
  .card-count {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .alert-card {
    flex: 1 1 100%;
  }
}
</style> 